home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_shs_trdoor.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
4KB
|
172 lines
# Jones 3D Cog Script
#
# SHS_TRdoor.cog Make the TR door open with monastic seal.
#
# [JWC, SXC]
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ========================================================================================
symbols
message activated
message startup
sector doorsector
sound placement=tem_tikikey_place_c.wav local
sound music0=mus_gen_awesome2.wav local
sound doormove=shs_door_double.wav local
keyframe inReach=in_reach_high.key local
thing door0 linkid=1
thing door1 linkid=1
thing player local
thing indy
thing doorcam1
thing doorcam_t1
thing key
int filter=0 local # prevent multiple activates
int whichItem local
int sealKey=87 local # item define
int keygrumble=0 local
int keyed=0 local
int curcam local
cog doortalkcog
end
# ========================================================================================
code
startup:
#turn off sector
SetSectorAdjoins(doorsector, 0);
SetThingFlags(key, 0x80000);
SetThingLight(door0, '.1 .1 .1', .01, .01);
SetThingLight(door1, '.1 .1 .1', .01, .01);
AttachThingToThing(key, door1);
player= GetLocalPlayerThing();
return;
activated:
# Check if door is being activated
If ((GetSenderId() == 1) && (keyed == 0))
{
# Check if inventory is being used...
whichItem = GetCurItem(player);
curCam = GetCurrentCamera();
# Prep for scene...
StartCutScene(1);
SetActorFlags(player, 0x200000);
StopThing(player);
PlayMode(player, 1, 0); # get him into a nice stand
DeselectWeapon(player); # stow any weapon or lighter
DeselectWeaponWait(player);
CopyPlayerHolsters(player, indy); # make sure actor has matching props
Sleep(0.1); # give him some time to do his stuff
# cut to observe the scene from a known position
# Prep camera & cut...
SetCameraLookInterp(2, 0); # kill pan & tilt to lock on 2nd target
SetCameraPosInterp(2, 0); # kill dolly mode too
SetCameraFocus(2, doorcam1);
SetCameraSecondaryFocus(2, doorcam_t1);
Sleep(0.01);
SetCurrentCamera(2);
SetCameraFOV(55, 0, 0.0);
# Switch actor indy for player...
SetThingFlags(player, 0x80000);
ClearThingFlags(indy, 0x80000);
Sleep(0.5);
if (whichItem == sealKey)
{
PlayKey(indy, inReach, 4, 0x12, 0);
sleep(1);
ClearThingFlags(key, 0x80000);
PlaySoundLocal(placement, 1.0, 0.0, 0x0, 1);
ChangeInv(player, sealKey, -1);
# "It fits!!!"
SendMessageEx(doortalkcog, user1, indy, 1, 2, 0);
while (global15 == 0)
{
Sleep(0.01); # wait for line to finish
}
# play some music!
PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
# open doors
SetSectorAdjoins(doorsector, 1);
sleep(.5);
Rotate(door0, -90, 1, 4.0);
Rotate(door1, 90, 1, 4.0);
PlaySoundLocal(doormove, 1.0, 0.0, 0x0, 0);
WaitForStop(door0);
keyed=1;
}
else
{
if (whichItem != 0)
{
# Take care of wrong keys and items...
PlayKey(indy, inReach, 4, 0x12, 1);
SendMessageEx(doortalkcog, user0, indy, sealKey, whichItem, 0);
}
else
{
if (keygrumble == 0)
{
# Note need for key 1st time thru...
SendMessageEx(doortalkcog, user4, indy, 1, 3, 0);
keygrumble = 1;
}
else
{
# General "door is locked" grmubling thereafter...
SendMessageEx(doortalkcog, user4, indy, 0, 0, 0);
}
}
while (global15 == 0)
{
Sleep(0.01); # wait for line to finish
}
}
Sleep(0.3);
CopyOrientAndPos(indy, player); # move player to actor's spot
SetCameraPosition(1, GetThingPos(doorcam1)); # prep for camera to swing back
SetCameraLookInterp(2, 0); # kill pan & tilt mode
SetCameraPosInterp(2, 0); # kill dolly mode
Sleep(0.01);
ResetCameraFOV( 0, 0.0);
SetCurrentCamera(curCam);
SetThingFlags(indy, 0x80000);
ClearThingFlags(player, 0x80000);
ClearActorFlags(player, 0x200000);
EndCutScene();
return;
}
end